﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using X.LOG.Abstract;

namespace X.LOG
{
    public abstract class Util
    {
        #region INFO
        /// <summary>
        /// 记录Info消息
        /// </summary>
        /// <param name="message">消息主体</param>
        public static async void Info(string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Info(message);
            });
        }

        /// <summary>
        /// 记录Info消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="message">消息主体</param>
        public static async void Info(string name, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Info(name, message);
            });
        }

        /// <summary>
        /// 记录Info消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="obj">要记录的对象实体</param>
        public static async void Info(string name, object obj)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Info(name, obj);
            });
        }
        /// <summary>
        /// 记录Info消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="message">消息主体</param>
        public static async void Info(Type type, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Info(type, message);
            });
        }

        /// <summary>
        /// 记录Info消息
        /// </summary>
        /// <param name="ex">异常信息</param>
        public static async void Info(Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Info(ex);
            });
        }
        /// <summary>
        /// 记录Info消息
        /// </summary>
        /// <param name="type">记录器名称</param>
        /// <param name="ex">异常信息</param>
        public static async void Info(string name, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Info(name, ex);
            });
        }
        /// <summary>
        /// 记录Info消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="ex">异常信息</param>
        public static async void Info(Type type, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Info(type, ex);
            });
        }

        #endregion

        #region DEBUG
        /// <summary>
        /// 记录Debug消息
        /// </summary>
        /// <param name="message">消息主体</param>
        public static async void Debug(string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Debug(message);
            });
        }

        /// <summary>
        /// 记录Debug消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="message">消息主体</param>
        public static async void Debug(string name, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Debug(name, message);
            });
        }

        /// <summary>
        /// 记录Debug消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="obj">要记录的对象实体</param>
        public static async void Debug(string name, object obj)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Debug(name, obj);
            });
        }
        /// <summary>
        /// 记录Debug消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="message">消息主体</param>
        public static async void Debug(Type type, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Debug(type, message);
            });
        }

        /// <summary>
        /// 记录Debug消息
        /// </summary>
        /// <param name="ex">异常信息</param>
        public static async void Debug(Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Debug(ex);
            });
        }
        /// <summary>
        /// 记录Debug消息
        /// </summary>
        /// <param name="type">记录器名称</param>
        /// <param name="ex">异常信息</param>
        public static async void Debug(string name, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Debug(name, ex);
            });
        }
        /// <summary>
        /// 记录Debug消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="ex">异常信息</param>
        public static async void Debug(Type type, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Debug(type, ex);
            });
        }

        #endregion

        #region WARN
        /// <summary>
        /// 记录Warn消息
        /// </summary>
        /// <param name="message">消息主体</param>
        public static async void Warn(string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Warn(message);
            });
        }

        /// <summary>
        /// 记录Warn消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="message">消息主体</param>
        public static async void Warn(string name, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Warn(name, message);
            });
        }

        /// <summary>
        /// 记录Warn消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="obj">要记录的对象实体</param>
        public static async void Warn(string name, object obj)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Warn(name, obj);
            });
        }
        /// <summary>
        /// 记录Warn消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="message">消息主体</param>
        public static async void Warn(Type type, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Warn(type, message);
            });
        }

        /// <summary>
        /// 记录Warn消息
        /// </summary>
        /// <param name="ex">异常信息</param>
        public static async void Warn(Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Warn(ex);
            });
        }
        /// <summary>
        /// 记录Warn消息
        /// </summary>
        /// <param name="type">记录器名称</param>
        /// <param name="ex">异常信息</param>
        public static async void Warn(string name, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Warn(name, ex);
            });
        }
        /// <summary>
        /// 记录Warn消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="ex">异常信息</param>
        public static async void Warn(Type type, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Warn(type, ex);
            });
        }

        #endregion

        #region ERROR
        /// <summary>
        /// 记录Error消息
        /// </summary>
        /// <param name="message">消息主体</param>
        public static async void Error(string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Error(message);
            });
        }

        /// <summary>
        /// 记录Error消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="message">消息主体</param>
        public static async void Error(string name, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Error(name, message);
            });
        }

        /// <summary>
        /// 记录Error消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="obj">要记录的对象实体</param>
        public static async void Error(string name, object obj)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Error(name, obj);
            });
        }
        /// <summary>
        /// 记录Error消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="message">消息主体</param>
        public static async void Error(Type type, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Error(type, message);
            });
        }

        /// <summary>
        /// 记录Error消息
        /// </summary>
        /// <param name="ex">异常信息</param>
        public static async void Error(Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Error(ex);
            });
        }
        /// <summary>
        /// 记录Error消息
        /// </summary>
        /// <param name="type">记录器名称</param>
        /// <param name="ex">异常信息</param>
        public static async void Error(string name, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Error(name, ex);
            });
        }
        /// <summary>
        /// 记录Error消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="ex">异常信息</param>
        public static async void Error(Type type, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Error(type, ex);
            });
        }

        #endregion

        #region FATAL
        /// <summary>
        /// 记录Fatal消息
        /// </summary>
        /// <param name="message">消息主体</param>
        public static async void Fatal(string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Fatal(message);
            });
        }

        /// <summary>
        /// 记录Fatal消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="message">消息主体</param>
        public static async void Fatal(string name, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Fatal(name, message);
            });
        }

        /// <summary>
        /// 记录Fatal消息
        /// </summary>
        /// <param name="name">记录器名称</param>
        /// <param name="obj">要记录的对象实体</param>
        public static async void Fatal(string name, object obj)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Fatal(name, obj);
            });
        }
        /// <summary>
        /// 记录Fatal消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="message">消息主体</param>
        public static async void Fatal(Type type, string message)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Fatal(type, message);
            });
        }

        /// <summary>
        /// 记录Fatal消息
        /// </summary>
        /// <param name="ex">异常信息</param>
        public static async void Fatal(Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Fatal(ex);
            });
        }
        /// <summary>
        /// 记录Fatal消息
        /// </summary>
        /// <param name="type">记录器名称</param>
        /// <param name="ex">异常信息</param>
        public static async void Fatal(string name, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Fatal(name, ex);
            });
        }
        /// <summary>
        /// 记录Fatal消息
        /// </summary>
        /// <param name="type">触发消息的对象类型</param>
        /// <param name="ex">异常信息</param>
        public static async void Fatal(Type type, Exception ex)
        {
            await Task.Run(() =>
            {
                Log4NetHelper.Fatal(type, ex);
            });
        }

        #endregion
    }
}
